﻿package ui.components{
	import flash.display.Sprite
	import flash.display.DisplayObject
	public class Component extends Sprite{
		protected var _width:Number = 0
		protected var _height:Number = 0
		protected var _minWidth:Number = 0;
		protected var _minHeight:Number = 0;
		public override function set width(w:Number):void{
			if(_width != w){
				_width = w;
				redraw()
			}
		}
		public override function set height(h:Number):void{
			if(_height != h){
				_height = h;
				redraw();
			}
		}
		
		public function get rwidth():Number{
			return Math.max(_width, _minWidth)
		}
		
		public function get rheight():Number{
			return Math.max(_height, _minHeight)
		}
		

		public function set minWidth(w:Number):void{
			if(_minWidth != w){
				_minWidth = w;
				redraw()
			}
		}
		
		public function set minHeight(h:Number):void{
			if(_minHeight != h){
				_minHeight = h;
				redraw()
			}
		}
		
		protected function redraw():void{
		}
	}
}